export default class {
  constructor(fetcher) {
    this.fetcher = fetcher;
  }
  /**
   *
   * @param {page: 1, size: 20} params
   */
  async getSuppliesListV1Api(page, size, params) {
    let result = await new Promise((resolve, reject) => {
      resolve({
        payload: {
          totalElements: 24,
          content: [
            { id: '1', name: '供应商A' },
            { id: '2', name: '供应商B' },
            { id: '3', name: '供应商C' },
            { id: '4', name: '供应商D' }
          ],
          number: 1,
          size: 20,
          totalPages: 2,
          numberOfElements: 20
        },
        code: '0',
        msg: 'ok'
      });
    });
    return result.payload;
  }

  /**
   *
   * @param {page: 1, size: 20} params
   */
  async getContractListV1Api(page, size, params) {
    let result = await new Promise((resolve, reject) => {
      resolve({
        payload: {
          totalElements: 24,
          content: [
            { id: '1', name: '供应商A' },
            { id: '2', name: '供应商B' },
            { id: '3', name: '供应商C' },
            { id: '4', name: '供应商D' }
          ],
          number: 1,
          size: 20,
          totalPages: 2,
          numberOfElements: 20
        },
        code: '0',
        msg: 'ok'
      });
    });
    return result.payload;
  }
  async getCarrywayListV1Api(page, size, params) {
    let result = await new Promise((resolve, reject) => {
      resolve({
        payload: {
          totalElements: 24,
          content: [
            { name: '经销商自提', id: 'bySelf' },
            { name: '配送医院', id: 'b' },
            { name: '大巴配送', id: 'c' },
            { name: '航空配送', id: 'd' },
            { name: '快递', id: 'e' },
            { name: '物流', id: 'f' }
          ],
          number: 1,
          size: 20,
          totalPages: 2,
          numberOfElements: 20
        },
        code: '0',
        msg: 'ok'
      });
    });
    return result.payload;
  }
  async getAddressListV1Api(page, size, params) {
    let result = await new Promise((resolve, reject) => {
      resolve({
        payload: {
          totalElements: 24,
          content: [
            { name: '孙志海', id: 'a', address: '北京市东城区青龙胡同1号 歌华大厦15层', phone: '13310139776' },
            { name: '马亮', id: 'c', address: '北京市西城区西什库大街8号 北京大学第一医院', phone: '15829109977' },
            { name: '斯琴格日勒', id: 'e', address: '石东路第三机床厂院内', phone: '13310139776' },
            {
              name: '嘉木样·洛桑久美·图丹却吉尼玛',
              id: 'f',
              address: '内蒙古自治区呼伦贝尔市扎赉诺尔区嘉和美地二期19号楼中央商城',
              phone: '13310139776'
            },
            {
              name: '司马义艾买提',
              id: 'b',
              address: '北京市西城区西什库大街8号 北京大学第一医院',
              phone: '15829109977'
            },
            { name: '刘平', id: 'd', address: '北京市西城区西什库大街8号 北京大学第一医院', phone: '15829109977' }
          ],
          number: 1,
          size: 20,
          totalPages: 2,
          numberOfElements: 20
        },
        code: '0',
        msg: 'ok'
      });
    });
    return result.payload;
  }

  /**
   *
   * @param {page: 1, size: 20} params
   */
  async getProductListV1Api(page, size, params) {
    let result = await new Promise((resolve, reject) => {
      resolve({
        payload: {
          totalElements: 24,
          content: [
            { id: '1', name: '产品1', count: 1 },
            { id: '2', name: '产品2', count: 2 },
            { id: '3', name: '产品3', count: 3 },
            { id: '4', name: '产品4', count: 4 },
            { id: '5', name: '产品5', count: 5 },
            { id: '6', name: '产品6', count: 6 },
            { id: '7', name: '产品7', count: 7 },
            { id: '8', name: '产品8', count: 8 },
            { id: '9', name: '产品9', count: 9 },
            { id: '10', name: '产品10', count: 1 },
            { id: '11', name: '产品11', count: 2 },
            { id: '12', name: '产品12', count: 3 },
            { id: '13', name: '产品13', count: 4 },
            { id: '14', name: '产品14', count: 5 },
            { id: '15', name: '产品15', count: 6 },
            { id: '16', name: '产品16', count: 7 },
            { id: '17', name: '产品17', count: 8 },
            { id: '18', name: '产品18', count: 9 },
            { id: '19', name: '产品19', count: 1 },
            { id: '20', name: '产品20', count: 1 },
            { id: '21', name: '产品21', count: 1 },
            { id: '22', name: '产品22', count: 1 },
            { id: '23', name: '产品23', count: 1 },
            { id: '24', name: '产品24', count: 1 }
          ],
          number: 1,
          size: 20,
          totalPages: 2,
          numberOfElements: 20
        },
        code: '0',
        msg: 'ok'
      });
    });
    return result.payload;
  }

  /**
   *
   * @param
   */
  async getOrderDetailV1Api(params) {
    let result = await new Promise((resolve, reject) => {
      resolve({
        payload: {
          id: '1',
          name: '产品1',
          supplier: '4',
          contract: '21',
          carryway: 'c',
          address: 'a',
          memo: 'test'
        },
        code: '0',
        msg: 'ok'
      });
    });
    return result.payload;
  }
}
